home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
MiscKit1.7.1
/
MiscKitArchive.mbox
/
mbox
/
000161_misckit-reques…aska.et.byu.edu_Fri Apr 1 17:13 MST 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-10-30
|
7KB
Received: from acs1.byu.edu by alaska.et.byu.edu; Fri, 1 Apr 1994 17:13:32 -0700
Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-7 #4169)
id <01HAO2NYAXC0IA0CWZ@yvax.byu.edu>; Fri, 1 Apr 1994 17:12:04 MST
Received: from alaska.et.byu.edu by yvax.byu.edu (PMDF V4.3-7 #4169)
id <01HAO2N15MJKQPFT4Z@yvax.byu.edu>; Fri, 1 Apr 1994 17:11:18 MST
Received: from acs1.byu.edu by alaska.et.byu.edu; Fri, 1 Apr 1994 17:07:59 -0700
Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-7 #4169)
id <01HAO2HWHLKGIA0CWZ@yvax.byu.edu>; Fri, 1 Apr 1994 17:07:11 MST
Received: from sonata.cc.purdue.edu by yvax.byu.edu (PMDF V4.3-7 #4169)
id <01HAO2GTLJMOQPFR5L@yvax.byu.edu>; Fri, 1 Apr 1994 17:06:18 MST
Received: from toccata.cc.purdue.edu by sonata.cc.purdue.edu
(NX5.67e/Purdue_CC) id AA22774; Fri, 1 Apr 94 19:06:08 -0500
Received: by toccata.cc.purdue.edu (NX5.67e/NX3.0X) id AA04810; Fri,
1 Apr 94 19:06:05 -0500
Received: by NeXT.Mailer (1.95)
Received: by NeXT Mailer (1.95)
Date: Fri, 01 Apr 1994 19:06:05 -0500
From: kane@sonata.cc.purdue.edu (Christopher Kane)
Subject: The birth of a notion: MiscAgent
To: misckit@byu.edu
Reply-to: kane@cs.purdue.edu
Message-id: <9404020006.AA22774@sonata.cc.purdue.edu>
Content-transfer-encoding: 7BIT
Status: RO
Don suggested there were probably people on the list who would be
interested in this message I had sent to him...
-----begin message----
Don't think about *HOW* this would be done, just think about the
possibility...
Premise: the development of classes like MiscRegistration,
MiscInfoController, and indeed many classes and categories, is to
provide the developer with a mechanism to achieve common goals/features
in an application that is as close to "plug-n-play" as possible,
alleviating the developer from doing the work.
Premise: the responder chain is a powerful user-interface mechanism
allowing users to send messages to application objects (via mouse
or keyboard).
Premise: developers would like a (mostly) automated, lazy, mechanism
for handling the loading of .nib files, loading of dynamically
loaded classes, and user-interface messages (such as those generated
from the application's menu).
Premise: that it would be possible, using the responder chain and
message forwarding mechanisms to build a class which 1) intercepted
messages of unknown destination on the responder chain, and forwarded
them to the appropriate class (loading the class first if necessary),
and 2) had mechanisms for limiting itself and subclasses to only
one instance (as many objects in the AppKit do). This class would
be a manager of classes; subclasses would be managers of other
classes, managers of .nib files (e.g., panels), managers of instances,
or managers of other things (who knows?).
"Conclusion": MiscAgent
A possible picture:
Responder
|
MiscAgent
...---+----------+------------------+---...
MiscInfoMenuAgent MiscNibAgent
+-----------------+--------------+-----...
MiscInfoPanelAgent MiscOrderFormAgent etc...
MiscNibAgent = MiscNibController +- a few things
Scenario #1: Charles, a developer, has the task of writing a news
reader application, as much as practical of which will be dynamically
loaded on demand. There are about half-a-dozen windows and panels
that he needs to create and manage, the main menu which will have
over 50 "leaf" menu items, a few specialized user-interface
controls/views, several custom objects to handle news-related
things, and many internal objects/categories to dynamically load
classes, .nib files, and perform clerical work of the application.
After planning his "attack" on the task, he adds the MiscAgent
class to his project, creates the panel nib files, creates a small
specialized subclass (of MiscNibAgent) for each panel, sets up the
main menu, connecting most of the menu cells to the first responder
(the connection is necessary to specify the action, unfortunately,
within IB), compiles the application and runs it to test much of
the interface. The panels pop up when the appropriate menu items
are clicked on. Since the classes control the panels, the classes
must have been loaded correctly (as well as the panels). Charles
doesn't know how this is happening--he doesn't care--as long as it
works.
Scenario #2: (a message odyssey) The user Barbara runs Charles'
application, and eventually clicks on the Info/Info Panel... menu
item. This menu item has no target, but it does have an action
(-orderFrontInfoPanel:). The AppKit responder chain message dispatch
engine goes to work first looking for a responder in the key window,
then the main window (if different), but none of those objects
implement the action message. The message finally is attempted to
be sent to the MiscAgent instance (how is not important right now),
which accepts the message. It then goes to work looking for a
class/instance that implements the message. Hmmm, the MiscInfoPanelAgent
has a method by that name. Hmmm, that class isn't loaded yet.
Let's load it, initialize it. Ok, send it the message. The newly
loaded class has .nib file loaded (via a method inherited from
MiscNibAgent) and displays it, and manages some animation. Barbara
sees the panel appear on the screen, with animation running. When
she leaves the Info Panel on-screen, and clicks on another window
(in the app) to work in it, the animation stops. The MiscInfoPanelAgent
has been made the delegate of the window, and is toggling the animation
in response to -windowDidBecomeKey and -windowWillBecomeKey methods.
I think this is a two/three/eight person project to do it well.
One key point, is that the responder chain becomes used by
classes which are not using it now. Another is that this is, in
many ways, quite an abstract class (though in a different way than
that term is meant with Object or Responder or Cell).
The two key difficulties are, 1) how does the MiscAgent "hook into"
the responder chain. There is no convenient mechanism (except the
NXApp's delegate, and I'd hate to "take" that) provided by the
AppKit. I can think of a mechanism or two, but I don't like that
sensation of my hair standing on end. :) And, 2) how does the object
know which classes implement which methods before loading. One way
would be a configuration file (the type of thing Opener.app has for
archive formats, for example). This file could be generated
automatically with an auxiliary tool at make time, and would reside
in the app wrapper. Other mechanisms may exist.
Sound interesting?
Christopher Kane